-
Notifications
You must be signed in to change notification settings - Fork 640
🌱 Enable optionalorrequired linter #5750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🌱 Enable optionalorrequired linter #5750
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @moko-poi. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
fe06ced to
bbd1f33
Compare
|
@moko-poi - did you mean to close this? I think i missed a message from you. |
|
Hi @richardcase, Yes, I closed this PR intentionally. The rebase work became quite challenging due to the large number of conflicts, so I'm planning to recreate the PR with a fresh approach. I'll open a new PR soon. Thank you for checking in! |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This PR enables the KAL (Kube-API-Linter)
optionalorrequiredlinter, which ensures that every field in API types is explicitly marked as either+optionalor+required.Changes made:
optionalorrequiredlinter in.golangci-kal.yml+optionalmarkers to fields withomitemptyjson tags+requiredmarkers to fields withoutomitemptyjson tagsThis improves API documentation clarity by making it explicit whether each field is required or optional, following Kubernetes API conventions. This helps API consumers better understand the contract of each field.
Which issue(s) this PR fixes:
Fixes #5491
Special notes for your reviewer:
The changes were made using a combination of automatic fixes (
make lint-api-fix) and a custom Python script to handle the remaining cases. The script adds markers based on the presence ofomitemptyin json tags:json:"...,omitempty"→// +optionaljson:"..."(no omitempty) →// +requiredAll changes are purely additive comments and do not affect runtime behavior. Tests pass successfully.
Checklist:
Release note: